############################################################## 
## MOD Title:           Toggle Admin CP Login
## MOD Author:          MarcuS < marcus.a.smith@ntlworld.com > (Mark S) http://www.phobbia.net
## MOD Description:     This mod allows a choice of disabling the ACP login introduced in phpBB 2.0.15
## MOD Version:         1.0.1
##
## Installation Level:  Easy
## Installation Time:   5 Minutes 
## Files To Edit:       4
##
##                      admin/admin_board.php
##                      admin/pagestart.php
##                      language/lang_english/lang_admin.php
##                      templates/subSilver/admin/board_config_body.tpl
##
## Included Files:      n/a
##
## License: http://opensource.org/licenses/gpl-license.php GNU Public License v2
############################################################## 
## For security purposes, please check: http://www.phpbb.com/mods/
## for the latest version of this MOD. Although MODs are checked
## before being allowed in the MODs Database there is no guarantee
## that there are no security problems within the MOD. No support
## will be given for MODs not found within the MODs Database which
## can be found at http://www.phpbb.com/mods/
############################################################## 
## Author Notes:        Many people find the Admin CP login annoying, especially if they are the only
##                      Administrator for that board.  This mod allows you to disable it.
##
##                      Tested on phpBB 2.0.16 - 2.0.17
## 
############################################################## 
## MOD History: 
## 
##   2005-07-30 - Version 1.0.1
##      - Release 2: Changed default for the ACP login as being required
##	- Toggle ACP Login works on phpBB 2.0.17 also
##
##   2005-07-18 - Version 1.0.0
##      - Release 1
## 
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
############################################################## 

# 
#-----[ SQL ]------------------------------------------ 
# 
INSERT INTO phpbb_config VALUES ('admin_login', '1');
# 
#-----[ OPEN ]------------------------------------------ 
# 
admin/admin_board.php
# 
#-----[ FIND ]------------------------------------------ 
# 
$smtp_yes = ( $new['smtp_delivery'] ) ? "checked=\"checked\"" : "";
$smtp_no = ( !$new['smtp_delivery'] ) ? "checked=\"checked\"" : "";
# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 

// Toggle ACP Login
$admin_login_yes = ( $new['admin_login'] ) ? "checked=\"checked\"" : "";
$admin_login_no = ( !$new['admin_login'] ) ? "checked=\"checked\"" : "";

# 
#-----[ FIND ]------------------------------------------ 
# 
	"L_SMTP_PASSWORD" => $lang['SMTP_password'], 
	"L_SMTP_PASSWORD_EXPLAIN" => $lang['SMTP_password_explain'],
# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
	// Toggle ACP Login
	"L_ADMIN_LOGIN" => $lang['admin_login'],
	"L_ADMIN_LOGIN_EXPLAIN" => $lang['admin_login_explain'],

# 
#-----[ FIND ]------------------------------------------ 
# 
	"SMTP_USERNAME" => $new['smtp_username'],
	"SMTP_PASSWORD" => $new['smtp_password'],
# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
	// Toggle ACP Login
	"ADMIN_LOGIN_YES" => $admin_login_yes,
	"ADMIN_LOGIN_NO" => $admin_login_no,

# 
#-----[ OPEN ]------------------------------------------ 
# 
admin/pagestart.php
# 
#-----[ FIND ]------------------------------------------ 
# 
if (!$userdata['session_logged_in'])
{
# 
#-----[ BEFORE, ADD ]------------------------------------------ 
# 

if ($board_config['admin_login'])
	{
# 
#-----[ FIND ]------------------------------------------ 
# 
if (!$userdata['session_admin'])
{
	redirect(append_sid("login.$phpEx?redirect=admin/index.$phpEx&admin=1", true));
}
# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
	}

# 
#-----[ OPEN ]------------------------------------------ 
# 
templates/subSilver/admin/board_config_body.tpl
# 
#-----[ FIND ]------------------------------------------ 
# 
	<tr>
		<td class="row1">{L_DISABLE_BOARD}<br /><span class="gensmall">{L_DISABLE_BOARD_EXPLAIN}</span></td>
		<td class="row2"><input type="radio" name="board_disable" value="1" {S_DISABLE_BOARD_YES} /> {L_YES}&nbsp;&nbsp;<input type="radio" name="board_disable" value="0" {S_DISABLE_BOARD_NO} /> {L_NO}</td>
	</tr>
# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
	<tr>
      		<td class="row1">{L_ADMIN_LOGIN}<br /><span class="gensmall">{L_ADMIN_LOGIN_EXPLAIN}</span></td>
      		<td class="row2"><input type="radio" name="admin_login" value="1" {ADMIN_LOGIN_YES} />{L_YES}&nbsp;&nbsp;<input type="radio" name="admin_login" value="0" {ADMIN_LOGIN_NO} />{L_NO}</td>
   	</tr>
# 
#-----[ OPEN ]------------------------------------------ 
# 
language/lang_english/lang_admin.php
# 
#-----[ FIND ]------------------------------------------ 
# 

//
// That's all Folks!
// -------------------------------------------------

# 
#-----[ BEFORE, ADD ]------------------------------------------ 
# 

// Toggle ACP Login
$lang['admin_login'] = "Admin CP Login";
$lang['admin_login_explain'] = "This allows you to determine whether the Admin CP re-authentication login requirement is necessary";

# 
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ 
# 
# EoM